/*********************************************************************
 * PhPaperBAll. Clase para PaperBin.
 * Programación Multimedia y Juegos
 * Autor: David Vallejo Fernández    david.vallejo@tegnix.com
 * Autor: Carlos González Morcillo   carlos.gonzalez@tegnix.com
 *
 * You can redistribute and/or modify this file under the terms of the
 * GNU General Public License ad published by the Free Software
 * Foundation, either version 3 of the License, or (at your option)
 * and later version. See <http://www.gnu.org/licenses/>.
 *
 * This file is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.  
 *********************************************************************/

package physic;

import aze.display.TileSprite;
import aze.display.TileLayer;

import phx.World;
import phx.Shape;

class PhPaperBin extends PhSprite {
  var _idBase:Int;

  // Create Shape =================================================
  override function createShape():Shape {
    // Borde izquierdo de la papelera
    _world.addStaticShape(new phx.Polygon ([new phx.Vector(6+x,9+y), 
					    new phx.Vector(14+x,62+y), 
					    new phx.Vector(20+x,62+y), 
					    new phx.Vector(12+x,9+y)], 
					   new phx.Vector(-32,-32))
			  );

    // Borde derecho de la papelera
    _world.addStaticShape(new phx.Polygon ([new phx.Vector(52+x,9+y), 
					    new phx.Vector(45+x,62+y), 
					    new phx.Vector(51+x,62+y), 
					    new phx.Vector(58+x,9+y)], 
					   new phx.Vector(-32,-32))
			  );

    // Base de la papelera
    var saux = new phx.Polygon ([new phx.Vector(19+x,52+y), 
				 new phx.Vector(20+x,62+y), 
				 new phx.Vector(45+x,62+y), 
				 new phx.Vector(46+x,52+y)], 
				new phx.Vector(-32,-32));
    _idBase = saux.id;
    _world.addStaticShape(saux);
    return null;
  }

  public function getIdBase():Int {return _idBase;}

  // Constructor ==================================================
  public function new(id:String, l:TileLayer, w:World, px:Float, 
		      py:Float):Void {
    super(id, l, w, px, py, false); 
  }

}